package com.c1.client.pan;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.awt.*;

/**
 * @author zhangjiangnan
 */
@Data
public class PanConf {
    private static volatile PanConf me;

    public static PanConf me() {
        if (me == null) {
            synchronized (PanConf.class) {
                if (me == null) {
                    me = new PanConf();
                }
            }
        }
        return me;
    }

    private PanConf() {
    }

    public GlobalStyle globalStyle = new GlobalStyle(40, 21, 107, 5, 25, 10, "FFFFFF");

    public BorderStyle borderStyle = new BorderStyle("000000", 1, 0.3f);
    public BoundaryStyle boundaryStyle = new BoundaryStyle("8B8386", 0.12f);

    public PosStyle commonPosStyle = new PosStyle(1, "000000", 1, false, 0.99f);
    public PosStyle ztPosStyle = new PosStyle(1, "FF0000", 3, false, 0.99f);
    public PosStyle weakZtPosStyle = new PosStyle(1, "800000", 3, false, 0.99f);

    public CjlStyle cjlStyle = new CjlStyle("000001", 0.7f, 17);
    public CjlStyle cjlLastMaxVolAndStrongStyle = new CjlStyle("FF0001", 0.35f, 17);
    public CjlStyle cjlLastBigMaxVolAndStrongStyle = new CjlStyle("FF0001", 0.99f, 17);

    public LineStyle lineStyle = new LineStyle("000001", 1, 0.25f);

    public InfoStyle xInfoStyle = new InfoStyle(15, "000000", 0.99f, Font.PLAIN);
    public InfoStyle yInfoStyle = new InfoStyle(13, "000000", 0.50f, Font.PLAIN);
    public InfoStyle yInfoStyle_ = new InfoStyle(14, "FF0000", 0.99f, Font.BOLD);


    @Data
    @AllArgsConstructor
    public static class PosStyle {
        public int w;
        public String c;
        public int stroke;
        public boolean solid;
        public float alpha;
    }

    @Data
    @AllArgsConstructor
    public static class InfoStyle {
        public int size;
        public String c;
        public float alpha;
        public int style;
    }

    @Data
    @AllArgsConstructor
    public static class LineStyle {
        public String c;
        public int stroke;
        public float alpha;
    }

    @Data
    @AllArgsConstructor
    public static class CjlStyle {
        public String c;
        public float alpha;
        public int integer;
    }

    @Data
    @AllArgsConstructor
    public static class BoundaryStyle {
        public String c;
        public float alpha;
    }

    @Data
    @AllArgsConstructor
    public static class BorderStyle {
        public String c;
        public int stroke;
        public float alpha;
    }


    @Data
    @AllArgsConstructor
    public static class GlobalStyle {
        public int up;
        public int xPerWidth;
        public int picHeight;
        public int picsInner;
        public int lRMargin;
        public int posCjlInter;
        public String panBak;
    }
}
